Technote 1146LaserWriter 8 and FontsBy David Gelphman and Ingrid KellyUpdated by David Gelphman Apple Worldwide Developer Technical Support |
CONTENTS
LaserWriter 8 Spooling and Fonts |
Many developers and prepress houses have contacted Apple for detailed information regarding how LaserWriter 8 works with fonts. They request this information so that they can better optimize their applications and workflows. This Technote gives a brief overview of font and printer driver interactions for LaserWriter 8, versions 8.6 and 8.6.5. |
LaserWriter 8 Spooling and FontsPrior to generating any PostScript code to image a given print job, LaserWriter 8 needs to know whether the fonts the document requires are available in the target output device. This affects the way the driver handles font queries and font downloading.Background printing During background printing (2-pass printing), LaserWriter 8 gathers information about all the font requirements of a document prior to generating any PostScript code to render the document. The first pass gathers the document's font requirements and saves the information in the spool file. This data consists of the QuickDraw name of each font used in the document (that is, the resource name of its 'FOND' resource), along with any QuickDraw style bits
(bold, italic, and so on.) applied to it. During the spooling pass,
LaserWriter 8 knows nothing about which fonts are resident in the
printer.At the beginning of its second pass, after all the application drawing has occurred and been recorded into the spool file, the driver issues a font query to find out which of the needed fonts are available on the target output device. See the section Font-Related Queries for more information about the form of the driver's font queries. Since the driver knows about all font usage at the start of the second (printing) pass, it can include downloadable fonts more intelligently. See the section Font Downloading below for more information. Foreground printing When a document is printed in foreground (one-pass printing), the driver cannot record all the font information in the document prior to generating the PostScript code to image the document. Therefore, the driver handles the font information as it goes along. Before the application does any drawing, LaserWriter 8 first obtains the complete list of fonts in the printer so it has this information before it generates any PostScript code. The Font-Related Queries and Font Downloading sections discuss in more detail how foreground printing is handled. Back to top Character EncodingsBecause Macintosh screen fonts and PostScript fonts may use different character encodings, LaserWriter 8 must sometimes redefine the encoding vector for each PostScript font used in the client's document to match the host font encoding. For each font, the driver's behavior is determined by bits 1 and 9 of the Font Classification word in the font's'FOND' resource. The Font
Classification word is described in Inside Macintosh:Text, pp.
4-100 through 4-101. |
'FOND'
Resource0 | Font name needs coordinating (ignored by LaserWriter 8) |
1 | Macintosh vector reencoding scheme is required |
2 | Font has outline property by changing PaintType to 2 |
3 | Disallows outlining simulation by smear and whiteout |
4 | Disallows emboldening by smear technique |
5 | Emboldening is simulated by increasing point size |
6 | Disallows obliquing for italic |
7 | Disallows automatic simulation of condensed style |
8 | Disallows automatic simulation of expanded style |
9 | Requires reencoding other than Macintosh vector encoding |
10 | Signifies the font family should have no additional
intercharacter spacing other than the space character |
11-15 | Reserved |
Mac-encoded fonts Fonts with bit 1 set are considered to be Mac-encoded fonts. For these fonts, the printer version of the font is "reencoded" so that the printer font used by the driver is encoded to correspond to the Macintosh Standard Roman Encoding. For Macintosh characters that are not included in Adobe's standard PostScript Roman character set, LaserWriter 8 generates PostScript code to use the printer's resident Symbol font and images them from there. Table 2 shows the mapping from Macintosh character codes to characters in the Symbol font. |
Character | Name | Mac Encoding (decimal) |
Symbol Encoding (decimal) |
¬ | notequal | 173 | 185 |
∞ | infinity | 176 | 165 |
≤ | lessequal | 178 | 163 |
≥ | greaterequal | 179 | 179 |
∂ | partialdiff | 182 | 182 |
∑ | summation | 183 | 229 |
∏ | product | 184 | 213 |
ϖ | pi | 185 | 112 |
∫ | integral | 186 | 242 |
Ω | Omega | 189 | 87 |
√ | radical | 195 | 214 |
≅ | approxequal | 197 | 187 |
Δ | Delta | 198 | 68 |
◊ | lozenge | 215 | 224 |
![]() |
Euro | 219 | 160 |
![]() |
apple | 240 | 240 |
Note 1: |
Note: |
Other Encoded Fonts A font whose Font Classification word does not have bit 1 set is not considered to be a Mac-encoded font. In this case, LaserWriter 8 does not apply the MacEncoding vector, and in addition does not switch to the Symbol font to image any characters; all characters are imaged out of the original font. If bit 1 is not set, the driver determines how to handle the encoding by looking to see whether bit 9 of the Font Classification word is set. This bit specifies whether the font is to be reencoded on the printer to a special encoding. If bit 9 is not set, the driver does no re-encoding of the font in the printer. If bit 9 is set, LaserWriter 8 changes the encoding of the printer font as described by the glyph-name encoding subtable. The format and location of the glyph-name encoding subtable in the 'FOND' is described in Inside Macintosh-Text, pp.
4-105 through 4-106.If bit 9 is set, the driver uses the glyph-name encoding subtable as a list of encoding positions and character names to change the PostScript font encoding. The list is used as a delta from the PostScript font's original encoding. For example, if the glyph-name encoding subtable contains two entries: ( $A8 , "diamond") ($A9 , "heart")
the LaserWriter driver changes the encoding of the PostScript font so
that it has the original encoding, only changed so that the encoding
vector at position $A8 now contains the name "/diamond" and that at $A9 contains the name "/heart".Special Case: Both bits 1 and bit 9 Set The LaserWriter driver special cases the situation where both bits 1 and bit 9 are set. In this case, it uses bit 9 as an indicator that a special encoding is needed and uses the glyph-name encoding subtable as described above to apply a delta encoding to the original font encoding vector. If bit 1 is also set, LaserWriter 8 treats the font as if it must switch to Symbol in order to image the set of characters listed in Table 2. Font KeysLaserWriter 8 generates PostScript code so that it draws in the QuickDraw coordinate system. This coordinate system has the origin at the top, left corner of the imageable area of the page (as defined by the print record margins) and the Y coordinate increases going down the page. Before using a font defined in standard PostScript format, LaserWriter 8 must invert the font matrix by applying a vertical scale factor of –1 (using the PostScriptmakefont operator) to compensate for the fact that the
font's coordinate system the font is flipped in Y from the
standard PostScript coordinate system. After applying this
modification, it saves the modified version of the font in its
md dictionary for later use under a font key of
the form /fm where m is a serial number denoting the
particular font and style. In addition, a font may be further modified to produce derived-style variations required by the client's document, such as synthetic bold, synthetic italic, outline, shadow, condensed, or extended. Each derived variation is considered a separate font and is given its own serial number for use in forming font keys. Thus, for example, the key /f724 might denote 12-point Helvetica synthetic bold outline. Outline and shadow versions of a font normally outline the characters by changing the PaintType entry in the font dictionary
from 0 to 2, causing the outline of each character to be stroked
instead of filled (PostScript Language Reference Manual, Second
Edition, section 5.2). However, this technique does not work with
some fonts (bitmap screen fonts in particular, as well as some
PostScript fonts such as older versions of Courier). If a font's
'FOND' classification word indicates that outlining
cannot be performed by using PaintType 2, the driver uses its own
PostScript routines to generate the outline and shadow forms by
'smearing" the character image: drawing it repeatedly with a slight
offset up, down, left, and right, followed by a final time, centered
in white, to “punch out” the interior of the character.
This smearing can be prevented by a font creator: setting bit 3 of
the font classification word prevents outline smearing, and setting
bit 4 prevents smearing for emboldening. See Table 1 above for more
information on these bit settings.In LaserWriter 8.6.5, users can check the "Annotate Font Keys" checkbox from the "Font Settings" panel, causing the driver to insert comments into the PostScript output stream immediately before it uses a font key. This feature was added to aid the troubleshooting of font problems in the PostScript files generated by LaserWriter 8. The comment inserted follows the form: %RBIFontKey: (Geneva) 12point bold
In this case, the font key represents application drawing in the QuickDraw font Geneva, 12 is the pointsize, and "bold" is the font style selected. Font DownloadingWhen searching for a downloadable font on the host Macintosh, LaserWriter 8 looks for any of the following, in order of priority:
|
Note: |
For fonts that are not already available on the target output device,
LaserWriter 8 attempts to download a suitable version from the host
Macintosh as part of the PostScript output stream. It first determines if the font is a Type 1
If the font is not a Type 1
1. Obtain the base font name from the style mapping table of the
2. Truncate each suffix to three characters needed to satisfy a
QuickDraw style as specified by the style mapping table. For example
the suffix "Bold" becomes "Bol" and "Light" becomes "Lig". Each
triple is appended to the truncated base name.
The driver searches for the font file in the following locations, in
the order listed: If the PostScript font file is not available on disk and the font is a classic TrueType version, it is handled as described in the Classic TrueType Support section. If the font is not a classic TrueType font but is instead an OFA-only font, the driver uses OFA to download the font. The section OFA Font Support below describes the details.
If the font is none of the above types, the driver uses the QuickDraw
bitmap (screen) version. Using the bitmap font, the driver constructs
a PostScript Type 3 font using the PostScript
Saving to Disk
When saving to a disk file rather than printing to a printer,
LaserWriter 8 never includes bitmap versions of PostScript fonts,
regardless of the "Font inclusion" setting in the Save dialog.
Instead, it simply includes an Adobe Document Structuring Conventions
(DSC)
Substitute Fonts
Standard Font Downloading When foreground printing, fonts are downloaded as they are encountered within a document. Each font is downloaded outside of the PostScript page level save, and therefore remains in the printer's VM for the duration of the job.
Unlimited Downloadable Fonts
Classic TrueType Support
If no PostScript version of a required font is available, either on
the target output device or on the host Macintosh, LaserWriter 8
looks for a classic TrueType font to download from the host machine.
LaserWriter 8 classifies a font as a classic TrueType font if it
contains a resource of type |
Note: |
Note: |
Background Printing
During background printing, the driver first spools all drawing to
disk. The print action verb
On the second pass of background printing, the driver uses the print
action verb
During foreground printing, the driver calls the print action routine with the verb Font-Related QueriesThe LaserWriter 8 driver uses two different font queries; one is for the availability of a specific set of fonts, while the other is for a full list of fonts available in the printer. The query used depends upon whether the driver is printing in foreground or background mode. Background Printing When background printing, the LaserWriter 8 driver gathers the list of PostScript fonts used in the document during the spool pass, and queries the printer about the availability of each font. The font query takes the following form:
The
For each required font, the driver uses the QuickDraw name recorded
in the spool file to access the font description resource, which
contains a style mapping table giving the corresponding PostScript
font name, which is dependent on the QuickDraw style attributes taken
from the spool file. The driver then uses this PostScript name in its
print-time font query. PostScript Level 1 output devices respond to
the query by reporting a font available if it is permanently resident
in the device's ROM, or if it is currently present in RAM or on a
disk connected to the device. On Level 2 devices, the query code
determines the font's availability via the PostScript
The response to the query indicates which of the specified fonts are already available on the target device; the driver then downloads the remaining fonts as part of the ensuing print job. See below for further specifics on this query.
Requests information about the availability of PostScript fonts on the target output device. LaserWriter 8 uses this information to decide which fonts to include as part of the ensuing print job. If the PostScript output is being saved to a disk file rather than sent directly to a printer, the equivalent information is provided by the user in the "Font inclusion" item of the Print dialog's Save panel. Under version 3.0 of the Document Structuring Conventions, the correct response to this query is of the form:
where each font name is followed by a colon and the word "Yes" if the given font is available on the target device, "No" if it is not. Notice that each font name is preceded by a slash character (/) in the response to the query, but not in the query itself. Notice also that the fonts appear in the response in reverse order from the way they are listed in the original query, and that the entire response is terminated with an asterisk (*). For example, the response to the query:
|
Note: |
Some print queue servers (notably the AppleShare print server prior to version 5.0) use an older form of response to the font query, as defined by version 2.0 (rather than 3.0) of the Document Structuring Conventions. For compatibility, LaserWriter 8 also accepts responses of this form. Such responses simply use the integers "1" and "0" instead of "Yes" and "No" to indicate font availability, and do not include the font names themselves or the terminating asterisk: for example, 10 1 1 As in the first form, the order of the fonts is reversed from the original query (Minion, Times-Bold, Times-Roman, and Helvetica in the example). |
Note: |
Foreground Printing When foreground printing, the LaserWriter 8 driver does not know which PostScript fonts will be used in a document, and must therefore query the printer for its complete set of fonts. This font list query takes the following form:
PostScript Level 1 output devices respond to the query by reporting all fonts available in FontDirectory and on
the printer's disk in the directory "fonts/". If it is
permanently resident in the device's ROM, or if it is currently
present in RAM or on a disk connected to the device, it is listed. On
Level 2 devices, the query code uses the PostScript
resourceforall operator with the /Font
resource category. This should list all fonts available to the output
device. See Adobe's PostScript Language Reference Manual for
more information on these PostScript language operators.The response to this query is the list of printer resident fonts in which each font name is preceded by a (slash) "/". The last font is followed by whitespace and an (asterisk) "*". For example, a printer might respond to the font list query with the following data:
See Adobe Technical Note #5001, PostScript Language Document Structuring Conventions Specification for more information on the font queries. In addition to the font queries just described, LaserWriter 8 queries the printer about the availability of a TrueType scaler. If the scaler is available, the query returns "Type42", and LaserWriter 8 downloads Type 42 fonts when appropriate. If the scaler is not in the printer, but the printer can accept a downloaded scaler, the query returns "Accept68K"; LaserWriter 8 then downloads a scaler to the printer and will download Type 42 fonts when appropriate. If the printer does not have and will not accept a TrueType scaler, the query returns "None"; LaserWriter 8 then converts TrueType fonts to unhinted Type 1 fonts and downloads these when appropriate. If the printer, or more likely a spooler, returns "Unknown" to the TrueType rasterizer query, LaserWriter 8 attempts to download the rasterizer and will send TrueType fonts down as both Type 42 and Type 1 when appropriate. The PostScript wrappers around the rasterizer and the fonts allow only the appropriate formats to be executed in the printer. The TrueType rasterizer query takes the following form:
Requests information about the ability of the target output device to accept fonts defined in Apple's TrueType format. Possible responses and their meanings are: |
Type42 | The device has a built-in copy of the TrueType scaler. |
Accept68k | The scaler is not built in but the device can accept it in downloaded form. |
None | The scaler is not built in and the device cannot accept it in downloaded form. |
Unknown | The characteristics of the device are unknown or the responding
spooler does not understand the query. |
As described earlier, LaserWriter 8.6.5 allows the user to choose the
"Never generate Type 42 format" setting, which causes the driver to
always treat the results of the Font Preferences BitsLaserWriter 8.6 and 8.6.5 contain a preferences resource that allows certain font-related behavior to be modified outside the normal driver user interface. Editing of this preferences resource can configure some of the driver's behavior when it handles fonts. The resource of interest is the'PRFS' resource of the
LaserWriter 8 file. In LaserWriter 8.6 and 8.6.5, there are three
font-related preferences bits that can be modified to affect the font
handling. The driver itself contains a 'TMPL' resource
to allow straightforward editing of these preferences in ResEdit or
Resorcerer®.Use Symbol Font for Euro Currency Symbol This preference setting in the 'PRFS' resource
controls whether the driver switches to the Symbol font to image the
Euro character encoded at 0xDB in fonts marked as
MacEncoding fonts by the Font Classification word in the 'FOND' . The driver preference setting is "ON" by default, and the driver switches to Symbol when imaging this character for MacEncoding fonts. If this preference setting is "OFF", the driver does not switch to Symbol but images the character in the 0xDB
position of the encoding vector in the original font. For fonts using
the Mac encoding vector, this character name is
'/Euro' .Ignore Fonts in Printer When Printing This driver preference setting is "OFF" by default, and the driver treats any printer fonts it finds in the query as available for usage. If this driver preference is set to "ON", the driver ignores printer fonts and downloads all fonts as if the printer contained no fonts. This preference does not apply to save to disk jobs since the user can explicitly set this in the Print dialog. In LaserWriter 8.6.5, there is explicit UI support for this feature with the "Always download needed fonts" checkbox in the "Font Settings" panel in the Print dialog. With LaserWriter 8.6.5, the default setting of this checkbox comes from the user's saved defaults. If the user has not saved a default value for this checkbox, then its default value comes from the 'PRFS'
value as described above.
Always Generate Type 1 Versions of TrueType Fonts This driver preference setting is "OFF" by default, and the driver will download Type 42 versions of classic TrueType fonts or OFA fonts if the printer can support them as described above. If this driver preference is set to "ON", the driver treats the printer as if it cannot support Type 42 fonts and can only accept Type 1 versions. In LaserWriter 8.6.5, there is explicit UI support for this feature with the "Never generate Type 42 format" checkbox in the "Font Settings" panel in the Print dialog. With LaserWriter 8.6.5, the default setting of this checkbox comes from the user's saved defaults. If the user has not saved a default value for this checkbox, then its default value comes from the 'PRFS'
value as described above.
PrintingLib Issues The "PrintingLib" file, version 8.6 and 8.6.5, contains a similar preferences resource of type 'PRF2' as well as an
appropriate 'TMPL' resource to allow straightforward
editing of these preferences in ResEdit or Resorcerer®. The two
preference settings "Ignore Fonts in Printer When Printing" and
"Always Generate Type 1 Versions of TrueType Fonts" are supported,
and have meanings and defaults as described above and can be changed
appropriately. Any user saved defaults made with LaserWriter 8.6.5
for these settings are respected; otherwise, the values from the
'PRF2' resource are used if there are no saved defaults.
The preference settings in PrintingLib apply only to drag-and-drop
printing through the Download Manager. See Technote 1169, "The
Download Manager" for more
information.For the shipping configuration of Mac OS 8.5, which includes only PostScript, EPS, PICT, and JPEG downloaders, these settings affect drag-and-drop printing of PostScript, EPS and PICT files. When doing drag-and-drop printing of PostScript or EPS files, the PostScript downloader supplies fonts to satisfy the '%%IncludeFont' and '%%IncludeResource:
font' DSC comments, and it respects these font preference
settings accordingly. Font usage in PICT files is handled in the same
manner as a standard print job but the PICT downloader uses the
settings of the preferences in the PrintingLib file to control this
special behavior. |
Note: |
SummaryWe hope that the detailed information contained in this Technote gives developers a good overview of how LaserWriter 8, versions 8.6 and 8.6.5, interacts with fonts.Further References
DownloadablesChange History
AcknowledgmentsThanks to John Blanchard, Rich Blanchard, and Paul Danbold. |